﻿using System;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;

namespace AnyOffice.general.email
{
    public partial class outbox_control : ModulePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int emailId = (Request.QueryString["email_id"] != null) ? int.Parse(Request.QueryString["email_id"].ToString()) : 0;
            int num2 = (Request.QueryString["page"] == null) ? 1 : int.Parse(Request.QueryString["page"].ToString());
            this.ViewState["page"] = num2;
            this.ViewState["position"] = (Request.QueryString["position"] == null) ? "outbox" : Request.QueryString["position"].ToString();
            int beforeId = 0;
            int nextId = 0;
            string str = string.Empty;
            new EmailDao().OutboxBeforeNext(base.Conn, emailId, ref beforeId, ref nextId);
            if (beforeId == 0)
            {
                str = "<< 上一封 ";
            }
            else
            {
                str = "<a href=\"javascript:parent.location='outbox_read_email.aspx?email_id=" + beforeId.ToString() + "&page=" + num2.ToString() + "'\"><< 上一封</a> ";
            }
            if (nextId == 0)
            {
                str = str + "| 下一封 >>";
            }
            else
            {
                string str2 = str;
                str = str2 + "| <a href=\"javascript:parent.location='outbox_read_email.aspx?email_id=" + nextId.ToString() + "&page=" + num2.ToString() + "'\"> 下一封 >></a> ";
            }
            this.litBeforeNext.Text = str;
        }
 

    }
}
